//
//  SelectImageForIpone.m
//  SchoolProduct
//
//  Created by feel on 16/9/6.
//  Copyright © 2016年 sm. All rights reserved.
//

//自建文件 作为承载页面

#import "SelectImageForIpone.h"
#import "ViewController.h"
#import "MKComposePhotosView.h"
#import "MKMessagePhotoView.h"
#define KWIDTH [UIScreen mainScreen].bounds.size.width

@interface SelectImageForIpone ()<MKMessagePhotoViewDelegate>

@property (nonatomic, strong) MKMessagePhotoView *photosView;
@end

@implementation SelectImageForIpone

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setUpPhotosView];

}

#pragma mark -相册视图
-(void)setUpPhotosView
{
    if (!self.photosView)
    {
        CGFloat w = 414 / kScreenW;
        CGFloat h = 736 / kScreenH;

        self.photosView = [[MKMessagePhotoView alloc]initWithFrame:CGRectMake(0,0,KWIDTH, 80/h)];
        [self.view addSubview:self.photosView];
        self.view.backgroundColor = [UIColor orangeColor];
        self.photosView.delegate = self;
    }
    
}

//实现代理方法
-(void)addPicker:(UIImagePickerController *)picker{
    
    [self presentViewController:picker animated:YES completion:nil];
}

-(void)addUIImagePicker:(UIImagePickerController *)picker{
    
    [self presentViewController:picker animated:YES completion:nil];
    self.modalPresentationStyle = UIModalPresentationOverCurrentContext;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
